package cn.itsource.common;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * Effect:
 * date: 2022/1/15 11:42
 *
 * @author wangyu
 * @since JDK 1.8
 */
@Data
public class AjaxResult {
    @ApiModelProperty("操作是否成功")
    private Boolean success=true;
    @ApiModelProperty("操作返回的提示信息")
    private  String msg="操作成功";
    private AjaxResult(){

    }
    private  AjaxResult(Boolean success, String msg){
        this.success=success;
        this.msg=msg;

    }
    public static AjaxResult success(String msg){
        return new AjaxResult(true,msg);
    }
    public static AjaxResult error(String msg){
        return new AjaxResult(false,msg);
    }

}
